<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>综合实践项目管理系统</title>
    <!-- Bootstrap core CSS -->
    <link href="../static/asserts/css/bootstrap.min.css" th:href="@{../static/asserts/css/bootstrap.min.css}" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="../static/asserts/css/dashboard.css" th:href="@{../static/asserts/css/dashboard.css}" rel="stylesheet">
    <style type="text/css">
        /* Chart.js */

        @-webkit-keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        @keyframes chartjs-render-animation {
            from {
                opacity: 0.99
            }
            to {
                opacity: 1
            }
        }

        .chartjs-render-monitor {
            -webkit-animation: chartjs-render-animation 0.001s;
            animation: chartjs-render-animation 0.001s;
        }
    </style>
</head>

<body>
<!--引入抽取的顶部文件-->
<div th:replace="commons/common :: top"></div>

<div class="container-fluid">
    <div class="row">
        <!--引入侧边栏-->
        <div th:replace="commons/common::#left"></div>
        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
            <h2>学生成绩评价</h2>
            <div class="table-responsive">
                <table class="table table-striped table-sm">
                    <thead>
                    <tr>
                        <th></th>
                        <th>学生名</th>
                        <th>项目名</th>
                        <th>成绩</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="stuscore:${comScoreList}">
                        <td><input type="checkbox"></td>
                        <td th:text="${stuscore.username}"></td>
                        <td th:text="${stuscore.pname}"></td>
                        <td th:text="${stuscore.companyresult}"></td>
                        <td th:text="评价" type="button" th:onclick="pj([[${stuscore.username}]]);" style="display: none" th:style="${stuscore.companystatus} == '0' ? 'display:show':'display:none'"></td>
                        <td th:text="已评价"  style="display: none" th:style="${stuscore.companystatus} == '1' ? 'display:show':'display:none'"></td>
                    </tr>
                    </tbody>
                </table>
            </div>

        </main>
    </div>
</div>

<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <form th:action="@{/comStuPj}" method="post" onsubmit="return checkData()">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" id="myModalLabel">
                        学生成绩评价
                    </h4>
                </div>
                <div class="modal-body">
                    名字:<input id="stuname" name="stuname" type="text"  readonly><br>
                    成绩:<input id="sturesult" name="sturesult" type="text">
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                    </button>
                    <button type="submit" class="btn btn-primary">
                        提交
                    </button>
                </div>
            </div><!-- /.modal-content -->
        </form>
    </div><!-- /.modal -->
</div>


<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type="text/javascript" src="../static/login/js/jquery-3.4.1.min.js" th:src="@{../static/login/js/jquery-3.4.1.min.js}"></script>
<script type="text/javascript" src="../static/asserts/js/popper.min.js" th:href="@{../static/asserts/js/popper.min.js}"></script>
<script type="text/javascript" src="../static/asserts/js/bootstrap.min.js" th:href="@{../static/asserts/js/bootstrap.min.js}"></script>

<!-- Icons -->
<script type="text/javascript" src="../static/asserts/js/feather.min.js" th:href="@{../static/asserts/js/feather.min.js}"></script>
<script>
    feather.replace()
</script>

<!-- Graphs -->
<script type="text/javascript" src="../static/asserts/js/Chart.min.js" th:href="@{../static/asserts/js/Chart.min.js}"></script>
<script>
    var ctx = document.getElementById("myChart");
    var myChart = new Chart(ctx, {
        type: 'line',
        data: {
            labels: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
            datasets: [{
                data: [15339, 21345, 18483, 24003, 23489, 24092, 12034],
                lineTension: 0,
                backgroundColor: 'transparent',
                borderColor: '#007bff',
                borderWidth: 4,
                pointBackgroundColor: '#007bff'
            }]
        },
        options: {
            scales: {
                yAxes: [{
                    ticks: {
                        beginAtZero: false
                    }
                }]
            },
            legend: {
                display: false,
            }
        }
    });
</script>
<script>
    function pj(data){
        document.getElementById("stuname").value = data;
        $('#myModal').modal('show');
    }
    function checkData() {
        var sturesult = document.getElementById("sturesult").value;

        if("" == sturesult ){
            alert("必填项不能为空！！！");
            return false;
        }
        var re = /^[1-9]\d*$/;//正整数
        if(!re.test(parseInt(sturesult))){
            alert("请输入正确的数字");
            return false;
        }
        return true;
    }
</script>
</body>
</html>